package com.tssm.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.tssm.common.dao.impl.BaseDAOImpl;
import com.tssm.dao.SarcReferDAO;
import com.tssm.pojo.SarcRefer;

@Repository("sarcReferDAO")
public class SarcReferDAOImpl extends BaseDAOImpl<SarcRefer> implements
		SarcReferDAO {

	/**查询货物参照数量**/
	public Integer queryReferCountById(Long id) {
		String hql = "select count(sr.referid) from SarcRefer sr where sr.supplierid="+id;
		Query query = super.getSession().createQuery(hql);
		Long count = (Long) query.uniqueResult();
		return count.intValue();
	}
}
